<%@ page contentType="text/html;charset=UTF-8" %>

<!--头部-->
<nav class="header-public">
    <div class="header-public-main">
        <div class="header-public-logo">
            <h1>
                <a href="${ctx}"> <img title="同行者" alt="同行者" src="${ctx}/image/logo_white.png"/>
                </a>
            </h1>
        </div>

        <ul class="header-public-nav-r">
            <li><a href="${ctx}">首页</a></li>
            <%--<c:if test="${empty sessionScope.newCurrentUser}">
                <li><a id="login_btn" href="javascript:void(0);">用户登录</a></li>
            </c:if>--%>
            <c:if test="${empty sessionScope.newCurrentUser}">
                <li><a id="partner_login_btn" href="${ctx}/pLogin.do">机构登录</a></li>
            </c:if>
            <c:if test="${not empty sessionScope.newCurrentUser}">
                <li class="header-user">
                    <div class="header-user-info">
                        <div class="user-logo common-img" >
                            <c:if test="${sessionScope.newCurrentUser.isPartner == 1  }">
                                <a href="${ctx}/member/membermgmt/list.do">
                                    <img src="${sessionScope.newCurrentUser.logo}"  onerror="txz.errImg(this)" onload="txz.imgLoad(this)" >
                                </a>
                            </c:if>
                            <c:if test="${sessionScope.newCurrentUser.type == 4}">
                                <a href="${ctx}/member/membermgmt/list.do">
                                    <img src="${sessionScope.newCurrentUser.logo}"  onerror="txz.errImg(this)" onload="txz.imgLoad(this)" >
                                </a>
                            </c:if>
                           <%-- <c:if test="${sessionScope.newCurrentUser.isCopartner == 1 && (sessionScope.newCurrentUser.isPartner == 0 || empty sessionScope.newCurrentUser.isPartner)}">
                                <a href="${ctx}/activity/zcActivity/zcActivityCopartnerList.do">
                                    <img src="${sessionScope.newCurrentUser.logo}"  onerror="txz.errImg(this)" onload="txz.imgLoad(this)" >
                                </a>
                         </c:if>--%>
                         </div>
                        <span class="user-name">${sessionScope.newCurrentUser.realname}</span>
                        <img src="${ctx}/image/other/dropdown_icon.png" class="dropdown-icon">
                    </div>
                    <div class="user-info">
                        <ul class="user-info-nav">
                            <shiro:hasRole name="partner">
                                <%--<li>--%>
                                    <%--<p class="f16" id="home_page">账户中心</p>--%>
                                <%--</li>--%>
                                <%--<li>--%>
                                    <%--<p class="f16" id="fund_mana">资金管理</p>--%>
                                <%--</li>--%>
                                <%--<c:if test="${!sessionScope.newCurrentUser.child || sessionScope.newCurrentUser.oneLevelChildren}">--%>
                                    <%--<li>--%>
                                        <%--<p class="f16" id="child_mana">子账号管理</p>--%>
                                    <%--</li>--%>
                                <%--</c:if>--%>
                                <%--<li>--%>
                                    <%--<p class="f16" id="xzgs_update">编辑资料</p>--%>
                                <%--</li>--%>
                            </shiro:hasRole>
                                <%--<li>--%>
                                <%--<p class="f16" id="myInfo">个人资料</p>--%>
                                <%--</li>--%>
                                <%--<li>--%>
                                <%--<p class="f16" id="wallet">帐户余额</p>--%>
                                <%--</li>--%>
                            <li>
                                <p class="f16" id="logout">退出</p>
                            </li>
                        </ul>

                    </div>
                </li>
                <li>
                    <a href="${ctx}/system/notify/getNotifyList.do">
                        <i class="icon iconfont icon-notice" style="font-size: 20px;"></i>
                        <span id="notifyCount" class="notify-label">0</span>
                    </a>
                </li>
            </c:if>
            <li><a href="${ctx}/about.do" id="">我是同行者</a></li>
            <li class="download-app"><a href="javascript:void(0)" rel="同行者">下载App</a>
                <div class="qr-code">
                    <div class="qr-item">
                        <img src="${ctx}/image/partner_app_qrcode.png" alt=""/>
                        <p>CEO社群联盟</p>
                    </div>
                    <div class="qr-item">
                        <img src="${ctx}/image/mgr_app_qrcode.png" alt=""/>
                        <p>机构版APP</p>
                    </div>
                </div>
            </li>
            <%--<c:if test="${not empty sessionScope.newCurrentUser}">--%>
                <%--<li><a href="${ctx}/help/help/list.do" target="_blank">帮助教程</a></li>--%>
            <%--</c:if>--%>
            <%--<li><a href="javascript:void(0);">4008-771-663</a></li>--%>
        </ul>
    </div>
    <%--	<div class="service-call"><i class="iconfont icon-call"></i>4008-771-663</div>--%>
</nav>
<div class="header-public-bot"></div>

<div class="right-nav-content"><a class="dn" id="top_back" href="javascript:void(0);"><i
        class="iconfont icon-totop f30"></i></a></div>

<script>

    $(function () {
        $('.f-def-dialog .close-icon').click(function () {
            $(this).closest('.f-def-dialog').fadeOut();
        });
        $('#login_btn').click(function () {
            $('#login_dialog').fadeIn();
            login();
        });

        $('#logout').on('click', function () {
            $.post('${ctx}/user/login/logout.do', function (res) {
                if (res.success) {
                    location.href = "${ctx}/pLogin.do"
                } else {
                    util.layerAlertError(res.description)
                }
            });
        });

        $('#home_page').on('click', function () {
            var isTwo = '${sessionScope.newCurrentUser.twoLevelChildren}';
            if (isTwo == 'true') {
                location.href = '${ctx}/member/group/childForm.do';
            } else {
                location.href = '${ctx}/system/member/memberIndex.do';
            }
        });
        $('#xzgs_update').on('click', function () {
            location.href = "${ctx}/system/member/memberForm.do";
        });

        $('#fund_mana').on('click', function () {
            location.href = "${ctx}/system/member/fundMana.do";
        });

        $('#child_mana').on('click', function () {
            location.href = "${ctx}/member/group/childList.do";
        })

        $("#myInfo").on('click', function () {
            location.href = "${ctx}/system/member/memberIndex.do";
        });

        $("#wallet").on('click', function () {
            location.href = "${ctx}/wallet/orderList.do";
        });

        if (${not empty sessionScope.newCurrentUser}) {
            // 获取消息数字
            $.post("${ctx}/system/notify/getNotifyCount.do", {}, function (res) {
                if (res.success) {
                    $("#notifyCount").text(res.data);
                }
            });
        }
    })

    function login() {
        $("#login_dialog .title").text("登录");
        $("#my_from").show();
        $("#findpwd_form").hide();
        $("#findpwd_form").find("input").val("");
    }

    function resetPwd() {
        $("#login_dialog .title").text("找回密码");
        $("#my_from").hide();
        $("#findpwd_form").show();
        $(".f-dialog-content").css("height", "auto");
        $("#my_from").find("input").val("");

        Vcode.params = {
            vMemberType: 2
        };
        Vcode.addEvent();
    }
</script>